package com.ai.entity.exam;

import com.ai.entity.BasePage;
import com.ai.entity.alarm.RecordAlarmPO;
import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.util.CollectionUtils;

/**
 * @Author：xiaosheng
 * @Date：2024-07-04 10:48
 */
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ExamRecordPage extends BasePage<ExamRecordPO> {

    @ApiModelProperty("账号")
    @TableField("account")
    private String account;

    @ApiModelProperty("用户名")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty("所属部门 1.生产部门  2.服务部门")
    @TableField("department")
    private String department;


    @Override
    public QueryWrapper<ExamRecordPO> getQuery(QueryWrapper<ExamRecordPO> queryWrapper) {

        return super.getQuery(queryWrapper).like(!StringUtils.isEmpty(account), "su.account", account)
                .like(!StringUtils.isEmpty(userName), "su.user_name", userName)
                .like(!StringUtils.isEmpty(department), "su.department", department);

    }


}
